package com.example.controller;

import com.example.pojo.JobOption;
import com.example.pojo.Result;
import com.example.pojo.StudentOption;
import com.example.service.ReportService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
//    统计员工职位数据
    @Autowired
    private ReportService reportService;

    @GetMapping("/authorGenderData")
    public Result getAuthorGenderData(){
        log.info("统计员工性别人数");
        List<Map<String,Object>> genderList =reportService.getAuthorGenderData();
        return Result.success(genderList);
    }


    @GetMapping("/articleCountData")
    public Result getArticlesCountData(){
        log.info("统计学生人数");
        StudentOption studentOption = reportService.getArticlesCountData();
        return Result.success(studentOption);
    }
}
